﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using G.Web;
using System.Xml.Serialization;
using System.Runtime.Serialization;

namespace G.WeiBo.WebAPI.Domain
{
    [DataContract]
    public class UserInfo : BaseObject
    {
        private string nickName;
        [XmlElement("name")]
        [DataMember(Name = "name")]
        public string NickName
        {
            get
            {
                return nickName;
            }
            set
            {
                if (value != nickName)
                {
                    this.nickName = value;
                    base.NotifyChanged("NickName");
                }
            }
        }

        private string screenName;
        [DataMember(Name = "screen_name")]
        [XmlElement("screen_name")]
        public string ScreenName
        {
            get
            {
                return screenName;
            }
            set
            {
                if (value != screenName)
                {
                    this.screenName = value;
                    base.NotifyChanged("ScreenName");
                }
            }
        }

        private string id;

        [DataMember(Name = "id")]
        [XmlElement("id")]
        public string Id
        {
            get
            {
                return this.id;
            }
            set
            {
                if (value != id)
                {
                    this.id = value;
                    base.NotifyChanged("Id");
                }
            }
        }

        private string description;

        [DataMember(Name = "description")]
        [XmlElement("description")]
        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                if (description != value)
                {
                    this.description = value;
                    base.NotifyChanged("Description");
                }
            }
        }

        private string gender;
        [DataMember(Name = "gender")]
        [XmlElement("gender")]
        public string Gender
        {
            get
            {
                return this.gender;
            }
            set
            {
                if (this.gender != value)
                {
                    this.gender = value;
                    base.NotifyChanged("Gender");
                }
            }
        }

        private string headImage;
        [DataMember(Name = "profile_image_url")]
        [XmlElement("profile_image_url")]
        public string HeadImage
        {
            get
            {
                return this.headImage;
            }
            set
            {
                if (headImage != value)
                {
                    this.headImage = value;
                    base.NotifyChanged("HeadImage");
                }
            }
        }
        private string province;
        [DataMember(Name = "province")]
        [XmlElement("province")]
        public string Province
        {
            get
            {
                return this.province;
            }
            set
            {
                if (value != province)
                {
                    this.province = value;
                    base.NotifyChanged("Province");
                }
            }
        }

        private string city;

        [DataMember(Name = "city")]
        [XmlElement("city")]
        public string City
        {
            get
            {
                return city;
            }
            set
            {
                if (city != value)
                {
                    this.city = value;
                    base.NotifyChanged("City");
                }
            }
        }

        private string location;

        [DataMember(Name = "location")]
        [XmlElement("location")]
        public string Location
        {
            get
            {
                return this.location;
            }
            set
            {
                if (location != value)
                {
                    this.location = value;
                    base.NotifyChanged("Location");
                }
            }
        }

        private string url;
        /// <summary>
        /// 博客地址
        /// </summary>
        [DataMember(Name = "url")]
        [XmlElement("url")]
        public string Url
        {
            get
            {
                return this.url;
            }
            set
            {
                if (this.url != value)
                {
                    this.url = value;
                    base.NotifyChanged("Url");
                }
            }
        }
        private string statusesCount;

        /// <summary>
        /// 微博数
        /// </summary>
        [DataMember(Name = "statuses_count")]
        [XmlElement("statuses_count")]
        public string StatusesCount
        {
            get
            {
                return this.statusesCount;
            }
            set
            {
                if (this.statusesCount != value)
                {
                    this.statusesCount = value;
                    base.NotifyChanged("StatusesCount");
                }
            }
        }

        private string friendsCount;
        /// <summary>
        /// 关注数
        /// </summary>
        [DataMember(Name = "friends_count")]
        [XmlElement("friends_count")]
        public string FriendsCount
        {
            get
            {
                return this.friendsCount;
            }
            set
            {
                if (this.friendsCount != value)
                {
                    this.friendsCount = value;
                    base.NotifyChanged("FriendsCount");
                }
            }
        }

        private string followersCount;
        /// <summary>
        /// 粉丝数
        /// </summary>
        [DataMember(Name = "followers_count")]
        [XmlElement("followers_count")]
        public string FollowersCount
        {
            get
            {
                return followersCount;
            }
            set
            {
                if (followersCount != value)
                {
                    this.followersCount = value;
                    base.NotifyChanged("FollowersCount");
                }
            }
        }

        private bool following;
        [DataMember(Name = "following")]
        [XmlElement("following")]
        public bool Following
        {
            get
            {
                return following;
            }
            set
            {
                if (following != value)
                {
                    this.following = value;
                    base.NotifyChanged("Following");
                }
            }
        }

        [DataMember(Name = "verified")]
        [XmlElement("verified")]
        public bool verified
        {
            get;
            set;
        }

        private Message message;

        [DataMember(Name = "status")]
        [XmlElement("status")]
        public Message Message
        {
            get
            {
                return message;
            }
            set
            {
                if (message != value)
                {
                    this.message = value;
                    base.NotifyChanged("Message");
                }
            }
        }

        public string MaxHeadImag
        {
            get
            {
                return this.HeadImage.Replace("/50/", "/180/");
            }
        }
    }
}
